package com.demo.zyt.modules.app.service.impl;


import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.demo.zyt.config.CommonParameters;
import com.demo.zyt.modules.app.dao.WxOrderDao;
import com.demo.zyt.modules.app.entity.WxOrderEntity;
import com.demo.zyt.modules.app.service.WxOrderService;


@Service("wxOrderService")
public class WxOrderServiceImpl extends ServiceImpl<WxOrderDao, WxOrderEntity> implements WxOrderService {

	@Override
	public String updateStatusByOrderId(String orderNum) {
		
		WxOrderEntity queryEntity = new WxOrderEntity();
		
		queryEntity.setOrderNum(orderNum);
		
		WxOrderEntity entity = this.baseMapper.selectOne(queryEntity);
		
		entity.setStatus(CommonParameters.IS_EFFECT.YES);
		
		this.updateById(entity);
		
		return entity.getPrepayId();
	}

	@Override
	public void updateNotifyStatusByOrderId(String orderNum) {
		WxOrderEntity queryEntity = new WxOrderEntity();
		
		queryEntity.setOrderNum(orderNum);
		
		WxOrderEntity entity = this.baseMapper.selectOne(queryEntity);
		
		entity.setNotifyStatus(CommonParameters.IS_EFFECT.YES);
		
		this.updateById(entity);
	}
	
	
	
}
